package org.example.web;

import org.example.server.NettyServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/netty/server")
public class NettyController {

    @Resource
    private NettyServer nettyServer;

    @GetMapping("/getAddress")
    public String getAddress() {
        return "[服务端]地址是：" + nettyServer.getChannel().localAddress();
    }

}
